package com.gao.xml.jaxb.xml;

import lombok.Data;

import javax.xml.bind.annotation.*;
import java.util.List;

/**
 * @author GaoXi
 * @date 2021/8/18 10:44
 */
@Data
//若不设置name属性，默认为类名的首字母小写->classInfo
@XmlRootElement(name = "Class")
//标识所有字段都不自动作为xml字段，只有加注解后才是
//@XmlAccessorType(XmlAccessType.NONE)
@XmlAccessorType(XmlAccessType.NONE)
public class ClassInfo {

    @XmlElement(name = "id")
    private String id;

    @XmlElement(name = "name")
    private String name;

    @XmlElement(name = "teach")
    private Teacher teacher;


 /*   @XmlElement(name = "stuInfo")
    private StudentInfo studentInfo;*/



//    @XmlElementWrapper(name = "sutInfo")
    @XmlElement(name = "stu")
    private List<Student> stu;

    public ClassInfo() {
    }

    public ClassInfo(String id, String name) {
        this.id = id;
        this.name = name;
    }
}
